#include "stm32f4xx.h"
#include <stdint.h>

#define HEADER1     0x55
#define HEADER2     0xAA
#define ENDER1      0x0D
#define ENDER2      0x0A
#define START       1


#define PAYLOAD_LEN 7
#define FRAME_LEN   (2 + 1 + PAYLOAD_LEN + 1 + 2) 

extern uint8_t receiveBuff[FRAME_LEN];

int usartReceiveOneData(int *p_leftSpeedSet, int *p_rightSpeedSet, uint8_t *p_ctrlFlag);

void usartSendData(int16_t leftVel, int16_t rightVel, int16_t angle, uint8_t ctrlFlag);

void USART_Send_String(uint8_t *p, uint16_t sendSize);

uint8_t getCrc8(uint8_t *ptr, uint16_t len);

void USART1_IRQHandler(void);


